{% extends "admin.base.html" %}
{% block adminbody %}
	{% if error %}
	<h1>Not found specified Top girl</h1>
	{% endif %}
	{% if model %}
	<h1>{{model.username}}</h1>
	<div><img class="avatar" src="{{host_img}}/{{model.username}}/{{model.avatar|imagename}}" alt="{{model.name}}"></div>
	<div class="topgirlformcontainer">
	<form name="topgirlform" method="POST" action="{{request.path}}">
		<table>
			<thead>
				<tr>
					<td>Name</td>
					<td>Value</td>
				</tr>
			</thead>
			<tbody>
				<tr><td>[中文]</td><td><input type="text" name="name_cn" value="{% if not model.name_cn %}{{model.name}}{% else %}{{model.name_cn}}{% endif %}"></td></tr>
				<tr><td>[English]</td><td><input type="text" name="name_en" value="{% if not model.name_en %}{{model.username}}{% else %}{{model.name_en}}{% endif %}"></td></tr>
				{% for cat in model.category %}
				<tr><td>Category</td><td><input type="text" name="category" value="{{cat}}"></td></tr>
				{% endfor %}
				{% if avatars %}
				<tr>
					<td>Avatar</td>
					<td>
					<ul>
					{% for a in avatars %}
					<li><input type="radio" name="avatar" value="{{a.key}}" {% ifequal a.url model.avatar %} checked {% endifequal %}/><img class="avatar" src="{{host_img}}/{{model.username}}/{{a.url|imagename}}" alt="{{model.name}}">
					{% endfor %}
					</ul>
					</td>
				</tr>
				{% endif %}
			</tbody>
			<tfoot>
			<tr><td><input type="submit" name="submit" value="Submit!"/></td></tr>
			</tfoot>
		</table>
	</form>
	</div>
	{% endif %}
{% endblock %}